home *** CD-ROM | disk | FTP | other *** search
- Path: shell.portal.com!not-for-mail
- From: clare@shell.portal.com (Clare Chu)
- Newsgroups: comp.lang.c++
- Subject: Overloading problem with kernal/Class read/write
- Date: 5 Feb 1996 12:41:28 -0800
- Organization: Portal Communications Company -- 408/973-9111 (voice) 408/973-8091 (data)
- Message-ID: <4f5q1o$5s6@jobe.shell.portal.com>
- NNTP-Posting-Host: jobe.shell.portal.com
-
-
- Hi, I'm sort of new to C++, so please bear with me.
-
- I wrote a little file class that has memberfunctions
- "read" and "write". Those member functions use the
- kernal "read" and "write". However when I try to
- link/load my program, the load map complains about
- the function signature of the kernal "read" and "write"
- as not being defined (it isn't the same signature
- as the File Class "read" and "write".
-
- I got around this by using "readin" and "writeout"
- as my member functions, but somehow this doesn't
- satisfy me. There's got to be a way for me to use
- "read" and "write", is there?
-
- Can someone explain? Thanks, Clare
- clare@shell.portal.com
- --------
-
- Here is a snippet of my class:
-
- class File {
- public:
- File(char *);
- ~File() {}
- int getFileDescriptor();
- int readin(char*, unsigned int);
- int writeout(char* , unsigned int);
- private:
- char *path;
- int fd;
- };
-
- The following member functions.
-
- File::readin(char* buf, unsigned int nbytes)
- {
- int nread;
- nread = read(fd,buf,nbytes);
- return nread;
- }
-
- File::writeout(char* buf, unsigned int nbytes)
- {
- int nwrite;
- nwrite = write(fd,buf,nbytes);
- return nwrite;
- }
-
-
-
-
-